Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ts-graphviz/adapter

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-graphviz/adapter

Graphviz Runtime adapters for Cross Platform

  • 0.0.0-pr956-20240225163634
  • develop
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@ts-graphviz/adapter

This module status is beta.

Provides an interface to run Graphviz dot commands.

Graphviz must be installed so that the dot command can be executed.

Execute the dot command to output a DOT language string to a stream or file.

Adapter State Machine

Usage

This module provides the following functions.

  • The toStream function converts DOT to Stream.
    import { toStream } from '@ts-graphviz/adapter';
    
    const dot = `
      digraph example {
        node1 [
          label = "My Node",
        ]
      }
    `;
    
    const stream = await toStream(dot, { format: 'svg' });
    // Node.js
    stream.pipe(process.stdout);
    // Deno
    await stream.pipeTo(Deno.stdout.writable);
    
  • Writes DOT to a file at the specified path toFile function
    import { toFile } from '@ts-graphviz/adapter';
    
    const dot = `
      digraph example {
        node1 [
          label = "My Node",
        ]
      }
    `;
    
    await toFile(dot, './result.svg', { format: 'svg' });
    

Note Designed to work with Node.js and Deno, Stream is runtime native.

For more examples and usage details, please refer to the ts-graphviz documentation.

Contributing

Contributions to the ts-graphviz project are welcome.

Please refer to the main ts-graphviz repository for guidelines on how to contribute.

License

This package is released under the MIT License.

Keywords

FAQs

Package last updated on 25 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc